#ifndef MIMETYPE_MANAGER_H
#define MIMETYPE_MANAGER_H

#include "../mimetypes/mimetype.h"

#include <QtCore/QHash>

QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE

namespace core
{

class MimeTypeManager
{
public:
    static MimeTypeManager* getInstance();
    static void destroy();

    void registerMimeType(const MimeType& type);
    void unregisterMimeType(const MimeType& type);

    MimeType mimeType(const QString& name) const;

    MimeType mimeTypeForUrl(const QUrl& url) const;

private:
    MimeTypeManager();
    ~MimeTypeManager();

private:
    QHash<QString, MimeType> m_registeredMimeTypes;
};

} // namespace core

#endif
